Class Project: Analysis of the S&P 500 to show historical trends based on past data¶

David Meduga S&DS 123

Introduction¶

The "The S&P500 is a market-capitalization-weighted index of 500 leading publicly traded companies in the U.S. The index actually has 503 components because three of them have two share classes listed."(investopedia) The S&P500 is a leading indicator in the finanical world that tells the world about how the economy is doing and the financial wellbeing of the top 500 companies. The object of this project is to make a analysis of the S&P500 and based on this data show investing strageties where it was most profitable to make a trade and either buy long or sell short. In my Final Project, I will be coding the adjusted returns from the S&P 500, taking the growth rate of specific stocks, use the top 9 stocks that makes up a majority of the S&P500 to show there growth over time, and using a basic investment strategy to show when it was the time to optimally purchase or sell a indidual stock in the S&P500.

The project focus is on the Financial world because the financial world encompases everything about the economy and a impact in the stock market is usually due to a world problem that causes a serious problem in the economy. Being able to track the stock market and see the changes in real time is staying ahead of the game and having this information is very valuable. This information leads to profits, real world impacts, and innovation. This is why I am doing a analysis on the S&P500 to see the historical trends and make trading decisions based on previous data.

There have been many other analysis of the the S&P500 ranging from corporations such as J.P. Morgan, Citidel, DRW Trading group. Each group has there own unique way of analysing the data and comes up with different conclusions on the most profitable trading strageties. They each use different techinques to bring about different amounts of profit and have a ranging varity of teams decitated to research the next stragety.

I obtained the data from the python package yfinance which is from yahoo finance. I used the link https://en.wikipedia.org/wiki/List_of_S%26P_500_companies to get the list of the S&P500 companies and there Ticker Symbols. I used the package yfinance

Data Wrangling¶

I am using adj_close = adjusted close of the stock,df= dataframe of the downloaded data from yfinance, fig = interavtive plots, top9stocks= top 9 stock in the S&P500, and rets = return rate. All other equations functions are explained as needed above the code.

Data installation¶

In [78]:
#run the pip install if you haven't already installed the data
#pip install yfinance
import pandas as pd
import yfinance as yf
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import plotly.express as px
import plotly.graph_objects as go 
from datetime import datetime
%matplotlib inline

S&P500 Companies¶

In [90]:
#The Wikipedia URL of the S&P 500
sp_wiki_url = "https://en.wikipedia.org/wiki/List_of_S%26P_500_companies"

# Reading the HTML table into a list of DataFrames
sp_wiki_df_list = pd.read_html(sp_wiki_url)

# Only getting the information needed containing the company information
sp_df = sp_wiki_df_list[0]

# Extract the ticker symbol columns
sp_ticker_list = list(sp_df['Symbol'].values)
In [80]:
#now downloading the ticker into yahoo finance to extract the rest of the stocks data over a 24 year period 
df = yf.download(sp_ticker_list, start='2000-01-01', end='2024-01-01')
[*********************100%%**********************]  503 of 503 completed

4 Failed downloads:
['BF.B']: Exception('%ticker%: No price data found, symbol may be delisted (1d 2000-01-01 -> 2024-01-01)')
['GEV', 'SOLV']: Exception("%ticker%: Data doesn't exist for startDate = 946702800, endDate = 1704085200")
['BRK.B']: Exception('%ticker%: No timezone found, symbol may be delisted')
In [81]:
#Getting the Adjusted close for each Stock 
adj_close = df['Adj Close']
In [82]:
#putting it into a colum
adj_close.columns
Out[82]:
Index(['A', 'AAL', 'AAPL', 'ABBV', 'ABNB', 'ABT', 'ACGL', 'ACN', 'ADBE', 'ADI',
       ...
       'WTW', 'WY', 'WYNN', 'XEL', 'XOM', 'XYL', 'YUM', 'ZBH', 'ZBRA', 'ZTS'],
      dtype='object', name='Ticker', length=503)
In [91]:
adj_close.head()
Out[91]:
Ticker A AAL AAPL ABBV ABNB ABT ACGL ACN ADBE ADI ... WTW WY WYNN XEL XOM XYL YUM ZBH ZBRA ZTS
Date
2000-01-03 43.613018 NaN 0.846127 NaN NaN 9.037449 1.277778 NaN 16.274672 28.438299 ... NaN 11.505329 NaN 6.978000 18.328697 NaN 4.680298 NaN 25.027779 NaN
2000-01-04 40.281464 NaN 0.774790 NaN NaN 8.779236 1.270833 NaN 14.909398 26.999622 ... NaN 11.073116 NaN 7.138672 17.977631 NaN 4.586223 NaN 24.666668 NaN
2000-01-05 37.782795 NaN 0.786128 NaN NaN 8.763098 1.388889 NaN 15.204176 27.393778 ... NaN 11.659706 NaN 7.414121 18.957693 NaN 4.609741 NaN 25.138889 NaN
2000-01-06 36.344173 NaN 0.718098 NaN NaN 9.069727 1.375000 NaN 15.328289 26.644882 ... NaN 12.205122 NaN 7.345259 19.937752 NaN 4.570541 NaN 23.777779 NaN
2000-01-07 39.372860 NaN 0.752113 NaN NaN 9.166555 1.451389 NaN 16.072983 27.393778 ... NaN 11.803779 NaN 7.345259 19.879250 NaN 4.468626 NaN 23.513889 NaN

5 rows × 503 columns

In [84]:
#pulling the S&P500 from yahoo finance and then using an interactive plot to show 
sp_ticker_list = ['^GSPC']
df = yf.download(sp_ticker_list, start='2000-01-01', end='2024-01-01')

#An interactive plot using Plotly
fig = px.line(df, x=df.index, y='Adj Close', title='S&P500 Adjusted Close Price')
fig.update_layout(
    xaxis_title='Date',
    yaxis_title='Price',
    height=800,
    width=1000
)
fig.show()
[*********************100%%**********************]  1 of 1 completed
In [100]:
#this is the specific S&P500 data I am pulling to show over time the growth of the index 
df = yf.download("^GSPC", start = '1980-01-01')
[*********************100%%**********************]  1 of 1 completed
In [101]:
#this is a interactive Candlestick graph which shows the open, close, high, and low of the S&P500
fig = go.Figure(data = [go.Candlestick(
    x = df.index,
    open = df['Open'],
    close = df['Close'],
    high = df['High'],
    low =df['Low']
)
])
fig.update_layout(title='Candlestick of the S&P500')
fig.show()
In [10]:
#this is an interactive candlestick chart to measure when the stock was going up and down in a bigger version 
fig.update_layout(
    title='Interactive Candlestick Chart',
    width=1200,  # Set the width of the chart
    height=800,  # Set the height of the chart
    xaxis_rangeslider_visible=False,  # Hide the range slider
    showlegend=False # Hide the legend
)

Real World Impacts¶

In [87]:
#Historical Financial crashes
important_dates = {
    'The Oil Crisis: 1982-04-29',
    'The Tech Bubble: 2000-09-11',
    'Financial Crisis and Great Recession: 2007-10-12',
    'Covid 19 Pandemic:2020-03-20',
}
In [89]:
#using the interactive graph from earlier and putting a line when the financial Crashes happened
fig = go.Figure(data = [go.Candlestick(
    x = df.index,
    open = df['Open'],
    close = df['Close'],
    high = df['High'],
    low =df['Low'],
)])
fig.update_layout(
    title= "S&P500 Shocks", 
    yaxis_title= "S&P500 Stock",
    shapes = [
        dict(
        x0 = '1982-04-29', x1= '1982-04-29', y0=0, y1=1, xref = 'x', 
        yref= 'paper', line_width = 2), 
        dict(
        x0 = '2000-09-11', x1= '2000-09-11', y0=0, y1=1, xref = 'x', 
        yref= 'paper', line_width = 2),
        dict(
        x0 = '2007-10-12', x1= '2007-10-12', y0=0, y1=1, xref = 'x', 
        yref= 'paper', line_width = 2),
        dict(
        x0 = '2020-03-20', x1= '2020-03-20', y0=0, y1=1, xref = 'x', 
        yref= 'paper', line_width = 2)
        
    ], 
    annotations = [
        dict(x= '1982-04-29', y = 1.1 , xref ='x', yref = 'paper', showarrow = False, 
             xanchor = 'left', text = 'The Oil Crisis'),
        dict(x= '2000-09-11', y = 1.1, xref ='x', yref = 'paper', showarrow = False, 
             xanchor = 'left', text = 'The Tech Bubble'),
        dict(x= '2007-10-12', y = 1.1, xref ='x', yref = 'paper', showarrow = False, 
             xanchor = 'left', text = 'Financial Crisis and Great Recession'),
        dict(x= '2020-03-20', y = 1.1, xref ='x', yref = 'paper', showarrow = False, 
             xanchor = 'left', text = 'Covid 19 Pandemic')
    ]
)
fig.update_layout(xaxis_rangeslider_visible= False)

Now Let's view the top stocks that make up a large portion of the S&P500¶

In [103]:
top9stocks = dict(
    AAPL = "Apple stock", 
    AMZN = 'Amazon Stock',
    NVDA = 'NVIDIA',
    GOOGL = 'Alphabet Class A',
    TSLA = 'Tesla',
    GOOG =  'Alphabet Class C',
    META = 'Meta Platforms Class A',
    MSFT = 'Miscroft Stock ',
    UNH = 'United Health Group'
)
In [104]:
list(top9stocks.keys())
Out[104]:
['AAPL', 'AMZN', 'NVDA', 'GOOGL', 'TSLA', 'GOOG', 'META', 'MSFT', 'UNH']
In [114]:
df_top9 = yf.download(list(top9stocks.keys()))
[*********************100%%**********************]  9 of 9 completed
In [121]:
adj_close_top9 = df_top9['Adj Close']
adj_close_top9 = adj_close_top9.dropna()

Top 9 Stocks Adjusted Close Over Time¶

In [122]:
adj_close_top9.dropna().plot(subplots = True, figsize = (12,10));
No description has been provided for this image
In [123]:
#A nice version of all the stock and there respected name
for key, value in top9stocks.items():
    print(f"{key:8s} | {value}")
AAPL     | Apple stock
AMZN     | Amazon Stock
NVDA     | NVIDIA
GOOGL    | Alphabet Class A
TSLA     | Tesla
GOOG     | Alphabet Class C
META     | Meta Platforms Class A
MSFT     | Miscroft Stock 
UNH      | United Health Group
In [139]:
#the dtype of the stocks 
adj_close_top9.info()
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 2989 entries, 2012-05-18 to 2024-04-05
Data columns (total 9 columns):
 #   Column  Non-Null Count  Dtype  
---  ------  --------------  -----  
 0   AAPL    2989 non-null   float64
 1   AMZN    2989 non-null   float64
 2   GOOG    2989 non-null   float64
 3   GOOGL   2989 non-null   float64
 4   META    2989 non-null   float64
 5   MSFT    2989 non-null   float64
 6   NVDA    2989 non-null   float64
 7   TSLA    2989 non-null   float64
 8   UNH     2989 non-null   float64
dtypes: float64(9)
memory usage: 233.5 KB
In [140]:
#roundung to the scond digit
adj_close_top9.describe().round(2)
Out[140]:
Ticker AAPL AMZN GOOG GOOGL META MSFT NVDA TSLA UNH
count 2989.00 2989.00 2989.00 2989.00 2989.00 2989.00 2989.00 2989.00 2989.00
mean 70.05 76.63 64.03 64.11 163.99 134.07 101.21 84.15 235.78
std 58.32 54.78 40.07 39.49 99.96 110.22 149.68 105.45 159.30
min 11.98 10.41 13.92 13.99 17.71 21.51 2.61 1.74 42.57
25% 24.04 21.27 29.16 29.66 81.82 40.33 5.24 14.33 100.13
50% 41.11 76.88 53.32 53.66 158.68 89.32 42.51 20.11 210.69
75% 128.52 121.84 94.97 94.65 210.91 232.71 136.81 182.00 373.80
max 197.86 186.57 156.50 155.49 527.34 429.37 950.02 409.97 548.93
In [120]:
adj_close_top9.mean()
Out[120]:
Ticker
AAPL      20.272440
AMZN      35.620083
GOOG      43.210114
GOOGL     43.278474
META     163.994460
MSFT      49.809822
NVDA      49.197997
TSLA      72.814922
UNH       80.403049
dtype: float64
In [124]:
#putting all the data gathered together
adj_close_top9.aggregate(['min', 'mean', 'std', 'median', 'max']).round(2)
Out[124]:
Ticker AAPL AMZN GOOG GOOGL META MSFT NVDA TSLA UNH
min 11.98 10.41 13.92 13.99 17.71 21.51 2.61 1.74 42.57
mean 70.05 76.63 64.03 64.11 163.99 134.07 101.21 84.15 235.78
std 58.32 54.78 40.07 39.49 99.96 110.22 149.68 105.45 159.30
median 41.11 76.88 53.32 53.66 158.68 89.32 42.51 20.11 210.69
max 197.86 186.57 156.50 155.49 527.34 429.37 950.02 409.97 548.93
In [126]:
adj_close_top9.diff().head()
Out[126]:
Ticker AAPL AMZN GOOG GOOGL META MSFT NVDA TSLA UNH
Date
2012-05-18 NaN NaN NaN NaN NaN NaN NaN NaN NaN
2012-05-21 0.934278 0.2130 0.341470 0.343093 -4.195549 0.385843 0.048159 0.080667 1.297375
2012-05-22 -0.130314 -0.1390 -0.331507 -0.333083 -3.026787 0.008038 -0.034400 0.135333 0.141384
2012-05-23 0.410910 0.0975 0.215691 0.216717 0.998940 -0.522503 0.068798 0.014667 -0.299370
2012-05-24 -0.158438 -0.1020 -0.144458 -0.145144 1.028908 -0.032150 -0.075677 -0.049333 0.715199
In [125]:
adj_close_top9.pct_change().round(3).head()
Out[125]:
Ticker AAPL AMZN GOOG GOOGL META MSFT NVDA TSLA UNH
Date
2012-05-18 NaN NaN NaN NaN NaN NaN NaN NaN NaN
2012-05-21 0.058 0.020 0.023 0.023 -0.110 0.016 0.017 0.044 0.029
2012-05-22 -0.008 -0.013 -0.022 -0.022 -0.089 0.000 -0.012 0.071 0.003
2012-05-23 0.024 0.009 0.014 0.014 0.032 -0.022 0.025 0.007 -0.006
2012-05-24 -0.009 -0.009 -0.010 -0.010 0.032 -0.001 -0.027 -0.024 0.016

Bar Graph of the Percentage Change¶

In [129]:
adj_close_top9.pct_change().mean().plot(kind = "bar", figsize = (5,5));
No description has been provided for this image
In [128]:
#shifting the data by 1 row down
adj_close_top9.shift(1)
Out[128]:
Ticker AAPL AMZN GOOG GOOGL META MSFT NVDA TSLA UNH
Date
2012-05-18 NaN NaN NaN NaN NaN NaN NaN NaN NaN
2012-05-21 16.036407 10.692500 14.953949 15.025025 38.189480 23.528463 2.770253 1.837333 44.901154
2012-05-22 16.970686 10.905500 15.295419 15.368118 33.993931 23.914307 2.818412 1.918000 46.198528
2012-05-23 16.840372 10.766500 14.963912 15.035035 30.967144 23.922344 2.784012 2.053333 46.339912
2012-05-24 17.251282 10.864000 15.179603 15.251752 31.966084 23.399841 2.852810 2.068000 46.040543
... ... ... ... ... ... ... ... ... ...
2024-04-01 171.479996 180.380005 152.259995 150.929993 485.579987 420.720001 903.559998 175.789993 494.700012
2024-04-02 170.029999 180.970001 156.500000 155.490005 491.350006 424.570007 903.630005 175.220001 489.700012
2024-04-03 168.839996 180.690002 155.869995 154.559998 497.369995 421.440002 894.520020 166.630005 458.140015
2024-04-04 169.649994 182.410004 156.369995 154.919998 506.739990 420.450012 889.640015 168.380005 459.739990
2024-04-05 168.820007 180.000000 151.940002 150.529999 510.920013 417.880005 859.049988 171.110001 455.380005

2989 rows × 9 columns

In [132]:
#Gettign the return rate of each stock
rets = np.log(adj_close_top9  / adj_close_top9.shift (1))

Return Rate Graph for Top 9 Stock in the S&P500¶

In [133]:
rets.cumsum().apply(np.exp).plot(figsize = (10,5));
No description has been provided for this image
In [134]:
#each graph indidually
rets.cumsum().apply(np.exp).plot(subplots = True, figsize = (12,10));
No description has been provided for this image

Resampling the data¶

In [136]:
# Resampling the data to every week the data will show
adj_close_top9.resample('1w', label = 'right').last().head()
Out[136]:
Ticker AAPL AMZN GOOG GOOGL META MSFT NVDA TSLA UNH
Date
2012-05-20 16.036407 10.6925 14.953949 15.025025 38.189480 23.528463 2.770253 1.837333 44.901154
2012-05-27 17.001228 10.6445 14.733027 14.803053 31.876179 23.359652 2.843637 1.987333 46.672581
2012-06-03 16.961924 10.4110 14.221195 14.288789 27.690619 22.869316 2.747319 1.876667 45.774384
2012-06-10 17.546379 10.9240 14.457061 14.525776 27.071278 23.833920 2.779426 2.005333 48.236084
2012-06-17 17.359217 10.9175 14.060049 14.126877 29.978193 24.131338 2.818412 1.994000 49.165634
In [137]:
# Resampling the data to every month the data will show
adj_close_top9.resample('1m', label = 'right').first().head()
Out[137]:
Ticker AAPL AMZN GOOG GOOGL META MSFT NVDA TSLA UNH
Date
2012-05-31 16.036407 10.6925 14.953949 15.025025 38.189480 23.528463 2.770253 1.837333 44.901154
2012-06-30 16.961924 10.4110 14.221195 14.288789 27.690619 22.869316 2.747319 1.876667 45.774384
2012-07-31 17.915253 11.4660 14.457560 14.526276 30.737387 24.565414 3.084429 2.026667 46.961941
2012-08-31 18.347319 11.6045 15.757935 15.832833 20.857868 23.641001 3.070669 1.750000 42.746559
2012-09-30 20.495804 12.3940 16.962421 17.043043 17.711208 24.590591 3.045443 1.876000 45.542900
In [138]:
# Newly resampled graph to show every month return rate
rets.cumsum().apply(np.exp).resample("1m", label = "right").last().plot(figsize = (10,5));
No description has been provided for this image

Total Price of Top 9 Stock in the S&P500¶

In [142]:
top9_stocks = dict(
    AAPL = "Apple stock", 
    AMZN = 'Amazon Stock',
    NVDA = 'NVIDIA',
    GOOGL = 'Alphabet Class A',
    TSLA = 'Tesla',
    GOOG =  'Alphabet Class C',
    META = 'Meta Platforms Class A',
    MSFT = 'Miscroft Stock ',
    UNH = 'United Health Group'
)
In [143]:
#dowloading the respective data
df1 = yf.download(list(top9_stocks.keys()))
[*********************100%%**********************]  9 of 9 completed
In [144]:
#dropping the NA's
df1= df1['Open'].dropna()
In [146]:
#The most recent data
df1.tail()
Out[146]:
Ticker AAPL AMZN GOOG GOOGL META MSFT NVDA TSLA UNH
Date
2024-04-01 171.190002 180.789993 151.830002 150.690002 487.200012 423.950012 902.989990 176.169998 494.470001
2024-04-02 169.080002 179.070007 154.750000 153.500000 485.100006 420.109985 884.479980 164.750000 459.600006
2024-04-03 168.789993 179.899994 154.919998 153.600006 498.929993 419.730011 884.840027 164.020004 462.000000
2024-04-04 170.289993 184.000000 155.080002 153.500000 516.419983 424.989990 904.059998 170.070007 460.820007
2024-04-05 169.589996 182.380005 151.679993 150.029999 516.859985 420.010010 868.659973 169.080002 450.690002
In [149]:
#now let look at Amazon Stock
symbol = 'AMZN'
window = 20 

df1['min'] = df1[symbol].rolling(window=window).min()
df1['mean'] = df1[symbol].rolling(window=window).mean()
df1['std'] = df1[symbol].rolling(window=window).std()
df1['median'] = df1[symbol].rolling(window=window).median()
df1['max'] = df1[symbol].rolling(window=window).max()
df1['ewma'] = df1[symbol].ewm(halflife= .5, min_periods = window).mean()

Amazon stock price change over a year¶

In [148]:
ax = df1[['min', 'mean', 'max']].iloc[-200:].plot(
    figsize = (10,6), style = ['g--', 'r--', 'g--'], 
    lw=.6
)
df1[symbol].iloc[-200:].plot(ax=ax, lw= 2.0);
No description has been provided for this image

Techinical Analysis Using Simple Moving Average¶

In [155]:
#Using rolling Statistics
df1['SMA1'] = df1[symbol].rolling(window=42).mean()
df1['SMA2'] = df1[symbol].rolling(window=252).mean()
In [153]:
df1[[symbol, 'SMA1', 'SMA2']].tail()
Out[153]:
Ticker AMZN SMA1 SMA2
Date
2024-04-01 180.789993 173.359047 138.433294
2024-04-02 179.070007 173.884523 138.740913
2024-04-03 179.899994 174.456666 139.049405
2024-04-04 184.000000 174.809285 139.373611
2024-04-05 182.380005 175.099285 139.689603
In [154]:
df1.dropna(inplace = True)
In [49]:
#this is 1 is holding long and 2 is short
df1['positions'] = np.where(df1['SMA1'] > df1['SMA2'], 1, -1)

Ploting Simple Moving Average¶

In [51]:
ax= df1[[symbol, 'SMA1', 'SMA2', 'positions']].plot(figsize= (10,6),
        secondary_y = 'positions')
ax.get_legend().set_bbox_to_anchor((0.25, 0.85))
No description has been provided for this image

Individual Stock Comparison¶

In [158]:
# Two Stocks competing in the same industry
stock1 = 'AAPL'
stock2 = 'MSFT'
In [159]:
df3 = yf.download([stock1, stock2])
[*********************100%%**********************]  2 of 2 completed
In [160]:
df3.dropna(inplace=True)
In [161]:
#comparison the two stock individualy
df3['Adj Close'].plot(subplots=True, figsize = (10,6));
No description has been provided for this image
In [162]:
df3 = df3['Adj Close']

Graph of Apple and Miscroft Stock rise Over Time¶

In [171]:
# Comparision of the stocks on the same graph
df3.loc['2010':'2019'].plot(secondary_y=stock2, figsize= (12,6));
No description has been provided for this image
In [172]:
df_small = df3.loc['2010':'2019']
In [173]:
#gathering the Return Rate of the Stocks 
rets1 = np.log(df_small / df_small.shift(1))
In [174]:
rets1.dropna(inplace=True)
In [175]:
#Plotting the return rate
rets1.plot(subplots = True, figsize = (10,6));
No description has been provided for this image
In [176]:
# Average increase
reg = np.polyfit(rets1[stock1], rets1[stock2], deg =1)
ax = rets1.plot(kind= 'scatter', x = stock1, y=stock2, figsize = (10,6))
ax.plot(rets1[stock1], np.polyval(reg, rets1[stock1]), 'r', lw=2);
No description has been provided for this image

Correlation¶

In [177]:
rets1.corr()
Out[177]:
Ticker AAPL MSFT
Ticker
AAPL 1.000000 0.458318
MSFT 0.458318 1.000000
In [178]:
#where the data from above shows on a graph with flucations
ax = rets1[stock1].rolling(window=252).corr(rets1[stock2]).plot(figsize=(10,6))
ax.axhline(rets1.corr().iloc[0,1], c = 'r');
No description has been provided for this image

Conclusion¶

In conclusion, the finding of doing the analysis of the S&P500 include: How different stocks are corelated with one another, how less frequent simple trading strategies actually trades, and how indidual stock moves in a general direction. From this analysis, I know how to use the package yfinance in python and do a deep dive into a stock analysis getting the returns and growth rate over time. This is very helpful in insight into investing in any stock. This code is very verstile is discovering a trend among stocks and can compare stocks to each other to find their corelation rate to diversify their portfolio. I also learned that every substantial dip/loss when analyzing the S&P500 is usually due a substantial world diaster or real world economy problem. Knowing this information being able to stay informed throughout news channels and articles will help me better understand the stock market and know how a certian event will influence the market. This analysis will help others to look at stocks they are interested in and be able to see inforamtion in a orgainzed way to help better the individual investments. Using Python we are able to explore all this data and discover model to optimize our investments.

Reflection¶

This was a fun assignment to do because I was able to see trends I never thought existed and be able to see how stocks change over time. This was a fun assignment to put together of how useful python is in the real world and how different profession do this for a living. For someone looking to invest this was a fun assignment on using data to find the best time to buy/sell a investment. It was difficult to plot the data and use the package yfinance effectivly but it was a good expereince in dealing with data.

Changes for Final Version¶

The changes I want to make for the final version include

  1. Adding a search feature where you enter in a stock and it will return you all the data through that one prompt
  2. A simulator where you can see how much money you will have if you invested a certain amount at a certain time in a stock.